package Page
{
    import Page.Page;
    
    public class PageChunk
    {
        private var _text:String;
        private var _page_start_index:int;
        private var _page_name:String;
        private var _page_index:int;
        private var _context:String;
        private var _line_number:int;
        private var _line_index:int;
        private var _context_index:int;
        private var _chunk_index:int;
//        private var _page:Page;
        
        // accepts RegExp exec result object
        public function PageChunk(s:String, name:String, index:int )
        {
            _text = s;
            _page_name = name;
            _page_start_index = index;
//            trace( _page_name, _line_index, _line_context);
        }
        
        public function get Text():String {
            return _text;
        }
        
        public function get ChunkContext():String {
        	return _context;
        }
        public function set ChunkContext(pStr:String):void {
        	_context = pStr;
        }
        
        public function get PageStartIndex():int {
            return _page_start_index;
        }
        
        public function get PageIndex():int {
        	return _page_index;
        }
        
        public function set PageIndex(i:int):void {
        	_page_index = i;
        }
        
        public function get PageName():String {
            return _page_name;
        }
        
        public function get ContextIndex():int {
        	return _context_index;
        }
        
        public function set ContextIndex(i:int):void {
        	_context_index = i;
        }
        
        public function get LineIndex():int {
        	return _line_index;
        }
        
        public function set LineIndex(i:int):void {
        	_line_index = i;
        }
        
        public function get LineNumber():int {
        	return _line_number;
        }
        
        public function set LineNumber(i:int):void {
        	_line_number = i;
        }
        
        public function get ContextSelectionStartIndex():int {
        	return _page_start_index - _context_index;
        }

        public function get ContextSelectionEndIndex():int {
			return ContextSelectionStartIndex + _text.length;        	
        }
        
    }
}